c# right function

118

c# right function -

    /// <summary>Get substring of specified number of characters on the right.
	/// There is no built-in 'Right' function in C#</summary>
    public static string Right(this string value, int length)
    {
        if (String.IsNullOrEmpty(value)) return string.Empty;
        return value.Length <= length ? value : value.Substring(value.Length - length);
    }

Comments

Submit
0 Comments